public class Main28 {
    //28、采用面向对象思想设计求矩形面积。
    public static void main(String[] args) {
        shape rectangle = new rectangle(10,10,"矩形");

        rectangle.area();
    }
}

class shape{
    double l;
    double wide;

    public shape(double l, double wide) {
        this.l = l;
        this.wide = wide;
    }

    public void area(){}
}

class rectangle extends shape{
    String name;

    @Override
    public void area() {
        System.out.println(this.name + "面积是：" + this.l*this.wide);
    }

    public rectangle(double l, double wide, String name) {
        super(l, wide);
        this.name = name;
    }
}